<?php
/**
* @package phpBB3 ATK - Admin Tool Kit
* @version $Id: index.php 179 2009-01-09 17:38:28Z ej.frerejean $
* @copyright (c) 2008 Admin Tool Kit community development team
* @author Erik Frèrerejean (Erik Frèrejean)
* @author Nathon Guse (EXreaction)
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/

define ('IN_ATK', true);

// Set some global variables
if (!defined('ATK_ROOT_PATH')) define('ATK_ROOT_PATH', './');
/*
* This is a different path due to my local setup.
* if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', ATK_ROOT_PATH . './../');
* ~ Erik
*/
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', ATK_ROOT_PATH . '../../../../quickinstall/boards/admin_tool_kit/');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));

// Load constants and functions
require ATK_ROOT_PATH . 'atk_constants.' . PHP_EXT;

// Do some common actions
require ATK_ROOT_PATH . 'atk_common.' . PHP_EXT;

// Login
$atk->login();

// Do the tool
$atk->tool_box();

// If we for what ever reason get here and we are running standalone, kill the admin session for this user
if (ATK_PANIC)
{
	redirect(ATK_ROOT_PATH . 'index.' . PHP_EXT, array('action' => 'atklogout'));
}
/*
// Set some paths because we need phpBB stuff we also set the $phpbb_root_path and $phpEx here
if (!defined('ATK_ROOT_PATH')) define('ATK_ROOT_PATH', './');
/*
* Due to my test environment.
* if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', ATK_ROOT_PATH . '../');
*
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', ATK_ROOT_PATH . '../../../../../quickinstall/boards/admin_tool_kit/');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));

// Set in ATK
define ('IN_ATK', true);

// Include some ATK constants
require ATK_ROOT_PATH . 'atk_constants.' . PHP_EXT;

// Load the functions file and core
require ATK_ROOT_PATH . 'includes/atk_functions.' . PHP_EXT;
require ATK_ROOT_PATH . 'includes/atk_core.' . PHP_EXT;

// Include config.php and construct the right core
if (false === (@include (ATK_ROOT_PATH . 'atk_config.' . PHP_EXT)))
{
	die (ATK_ROOT_PATH . 'atk_config.' . PHP_EXT . ' couldn\'t be found. Please check your ATK installation!');
}

$panic_tools = false;
if (isset($config['atk_password']) && !empty($config['atk_password']) && isset($config['atk_stand_alone']) && $config['atk_stand_alone'] === true)
{
	$panic_tools = true;
	// Need to include a seperate core
	//require ATK_ROOT_PATH . 'includes/atk_panic_core.' . PHP_EXT;
	//$class = 'atk_panic';
	//define('ATK_PANIC_TOOL', true);
}
else
{
	//$class = 'atk_core';
	//define('ATK_PANIC_TOOL', false);
}
define('ATK_PANIC_TOOL', $panic_tools);

// Construct
$atk = new atk_core();

// Include the right phpBB core and load the final vars
require ATK_ROOT_PATH . 'includes/' . $atk->phpbb_class . '.' . PHP_EXT; //-- Has to be done here due to issues with the phpBB vars when stuffing this in the class :(
$atk->load();

// Check login
if ((!isset($user) || !$user->data['is_registered']) && $atk->get_config('atk_password'))
{
	// Use our own login method
	$atk->atk_login();
}
else
{
	// Use the phpBB login methods
	$atk->login();
}

// Always exit here
die("!");
*/
?>